#!/bin/sh
#
# Webif-theme-urbalink post-install script.
#
echo ""
echo "urbalink potsintall message Configuring webif"
echo "Original webif"
cat ${IPKG_INSTROOT}/etc/config/webif
cat ${IPKG_INSTROOT}/etc/config/webif | sed -e '/option *.*id.*/d' | sed -e '/config *.*webif.* *.*theme.*/d' > ${IPKG_INSTROOT}/tmp/new_webif
echo "
config 'webif' 'theme'
	option 'id' 'urbalink'
" >> ${IPKG_INSTROOT}/tmp/new_webif
echo "Modified webif"
cat ${IPKG_INSTROOT}/tmp/new_webif
#mv ${IPKG_INSTROOT}/tmp/new_webif ${IPKG_INSTROOT}/etc/config/webif
	rm -rf "${IPKG_INSTROOT}/www/themes/active"
	ln -sf "${IPKG_INSTROOT}/www/themes/urbalink" "${IPKG_INSTROOT}/www/themes/active"
	rm -rf "${IPKG_INSTROOT}/www/themes/active"
	ln -sf "${IPKG_INSTROOT}/www/themes/urbalink" "${IPKG_INSTROOT}/www/themes/active"
exit 0
